export function getDevice(){
  let userAgent = navigator.userAgent;
  if (userAgent.indexOf('Android') > -1 || userAgent.indexOf('Adr') > -1) {
    return 'android'
  } else if (userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)){
    return 'iphone'
  } else {
    return 'unknow'
  }
}

export function isWeixin(){
  let ua = navigator.userAgent.toLowerCase();
  if (ua.match(/MicroMessenger/i) == "micromessenger") {
      return true;
  }
  return false;
}